package march.test_3_30;

import java.util.Scanner;

public class TestMain2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[n];
        int max = 0;
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
            if(array[i] > max) {
                max = array[i];
            }
        }
        int[] results = getResults(array,max);
        for (int i = 0; i < results.length; i++) {
            System.out.print(results[i] + " ");
        }
    }
    public static int[] getResults(int[] array,int max) {
        int n = array.length;
        int[] results = new int[n];
        for (int i = 0; i < n; i++) {
            int[] tmp = array.clone();
            tmp[i] *= 2;
            int t = tmp[i];
            if(t > max) {
                results[i] = t;
            } else {
                results[i] = max;
            }
        }
        return results;
    }
}
